/**
 * new 操作符
 * @param {Function} fn
 * @param  {...any} args
 */
export function newInstance(fn, ...args) {
  const obj = {}
  obj.__proto__ = fn.prototype
  const result = fn.call(obj, ...args)
  return result instanceof Object ? result : obj
}
